#include "scenes/SceneGame.h"

#include "scenes/GameScene.h"
#include "scenes/GameSceneMain.h"

SceneGame::SceneGame( GameApplication& theApp )
   : App( theApp )
{
}

void SceneGame::Initialize()
{
	gameScenes.AddScene( "Main", new GameSceneMain( App, ( * this ) ) );
	gameScenes.SetActiveScene( "Main" );
}

void SceneGame::Terminate()
{
	// None
}

void SceneGame::Step( gdn::Window& window )
{
	gdn::Event Event;
	while ( window.GetEvent( Event ) )
	{
		static_cast< GameScene* >( gameScenes.FindScene( gameScenes.GetActiveSceneName() ) )->Step( Event );
	}

	static_cast< GameScene* >( gameScenes.FindScene( gameScenes.GetActiveSceneName() ) )->Step();
}

void SceneGame::Draw( gdn::Window& window )
{
	window.Clear();

	gameScenes.FindScene( gameScenes.GetActiveSceneName() )->Draw( window );

	window.Display();
}

